<?php
class Forms_CreateUserForm extends Zend_Form 
{ 
    public function init()
    {  	
    	//$this->addPrefixPath('forms_validators', 'forms/validators/', 'validate');
    	//$this->addElementPrefixPath('forms_validators', 'forms/validators/', 'validate'); 
        $this->setName('create_user');

        $userName = new Zend_Form_Element_Text('userName');
        $userName->setLabel('User Name')
        	->addPrefixPath('Form_Validator', 'forms/validators/', 'validate')
        	->setRequired(true)
        	->addValidator('NotEmpty')
        	->addValidator('UniqueDBTableEntryValidator',false,array('table'=>new Users(), 'field'=>'username'));
		
        $email = new Zend_Form_Element_Text('email');
        $email->setLabel('Email address (will be used for validation)')
        	->setRequired(true)
        	->addValidator("emailAddress");
        
        $nickName = new Zend_Form_Element_Text('nickName');
        $nickName->setLabel('Nick Name')
        	->setRequired(true)
        	->addValidator('NotEmpty');

        $password = new Zend_Form_Element_Password('password'); 
        $password->setLabel('Password')
        	->setRequired(true)
        	->addValidator('NotEmpty', true);
        	
        
        $passwordConfirm = new Zend_Form_Element_Password('passwordConfirm'); 
        $passwordConfirm->setLabel('Confirm Password')
        	->addPrefixPath('Form_Validator', 'forms/validators/', 'validate')
        	->addValidator('ConfirmationFieldValidator',false,array('password'));

              
        
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Create');

        $this->addElements( array(	$userName, 
        							$email,
            						$nickName, 
            						$password,
            						$passwordConfirm, 
            						$submit));
        
    } 
}
?>